enum PlayerState {
  idle,
  loading,
  playing,
  paused,
  stopped,
  error,
}

extension PlayerStateExtension on PlayerState {
  String get displayName {
    switch (this) {
      case PlayerState.idle:
        return '空闲';
      case PlayerState.loading:
        return '加载中';
      case PlayerState.playing:
        return '播放中';
      case PlayerState.paused:
        return '已暂停';
      case PlayerState.stopped:
        return '已停止';
      case PlayerState.error:
        return '错误';
    }
  }
}
